package com.nxmu.action;

import com.nxmu.entity.OfficeEnter;
import com.nxmu.service.OfficeEnterService;
import com.opensymphony.xwork2.ModelDriven;

import java.util.List;

public class OfficeEnterAction extends BaseAction implements ModelDriven<OfficeEnter> {

    private OfficeEnter officeEnter;

    private List<OfficeEnter> list;

    public List<OfficeEnter> getList() {
        return list;
    }

    private OfficeEnterService officeEnterService;

    public void setOfficeEnterService(OfficeEnterService officeEnterService) {
        this.officeEnterService = officeEnterService;
    }

    public String enter(){
        officeEnterService.enterOfficeEnter(officeEnter);
        return SUCCESS;
    }

    public String list(){
        list = officeEnterService.getAll();
        return "list";
    }

    @Override
    public OfficeEnter getModel() {
        officeEnter = new OfficeEnter();
        return officeEnter;
    }
}
